<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Library management system</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>

    <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>

    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <!--    <style>-->
    <style>
        body{
            background-image:url("https://img.17sucai.com/upload/55/2013-05-18/884aa4be28287056c7b5d6d075382c51.jpg?x-oss-process=style/big");
        }
        h1
        {
            color:orange;
            text-align:center;
        }

        div.margin
        {
            margin-top:50px;
            margin-bottom:100px;
            margin-right:400px;
            margin-left:400px;
        }

    </style>

</head>


<body>
<h1>管理员登陆界面</h1>
<div class="container">

    <img src="http://www.obzhi.com/wp-content/uploads/2020/12/tushuguan3-1024x576.jpg" width="512px" height="300px"/>
    <form action="/library/user"  method="post" onsubmit="return checkForm()">
        <div class="form-group">
        username：<input type="text" id="username" name="username" /><br>
        password：<input type="password" id="password" name="password" /><br>
        </div>
        <button type="submit" class="btn btn-primary">登录</button>
    </form>


    <script type="text/javascript">
        function checkForm(){

            var username = document.getElementById("username").value;
            var password = document.getElementById("password").value;

            if(username=="adminer" && password=="123"){
                alert("登录成功");
                // window.location.href= "/list";
                // 前往图书列表界面
                return true;
            }
            else{
                alert("账号或密码错误");
                // window.location.href= "/";
                return false;
            }
        }
    </script>

</div>
</body>
</html>